package com.miniot.base.controller;

import com.miniot.base.dto.*;
import com.miniot.base.service.VsualizationService;
import com.miniot.base.vo.CountVO;
import com.miniot.business.base.BaseController;
import com.miniot.business.base.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@AllArgsConstructor
@RequestMapping("/vsualization" )
@Api(value = "可视化(后台)", tags = "可视化-后台接口")
public class VsualizationController extends BaseController {
    private final VsualizationService vsualizationService;
    /**
     * 统计分析
     * @return Result
     */
    @GetMapping("/count")
    @ApiOperation(value = "统计分析")
    public R<CountVO> count() {
        return R.success(vsualizationService.countNum(),"查询成功");
    }
    /**
     * 仓库列表
     * @return Result
     */
    @GetMapping("/getWarehouseManage")
    @ApiOperation(value = "仓库列表")
    public R<List<WarehouseManageDTO>> getWarehouseManage() {
        return R.success(vsualizationService.getWarehouseManage(),"查询成功");
    }
    /**
     * 物资品牌展示
     * @return Result
     */
    @GetMapping("/getLogo")
    @ApiOperation(value = "物资品牌展示")
    public R<List<GetLodoDTO>> getLogo() {
        return R.success(vsualizationService.getLogo(),"查询成功");
    }
    /**
     * 物资类型统计
     * @return Result
     */
    @GetMapping("/getTotal")
    @ApiOperation(value = "物资类型统计")
    public R<List<GetTotalDTO>> getTotal() {
        return R.success(vsualizationService.getTotal(),"查询成功");
    }
    /**
     * 出入库趋势
     * @return Result
     */
    @GetMapping("/getDetail")
    @ApiOperation(value = "出入库趋势")
    public R<List<GetDetailDTO>> getDetail() {
        return R.success(vsualizationService.getDetail(),"查询成功");
    }
    /**
     * 出入库明细
     * @return Result
     */
    @GetMapping("/getWarehouseManageDetail")
    @ApiOperation(value = "出入库明细")
    public R<List<BoundManageForDTO>> getWarehouseManageDetail() {
        return R.success(vsualizationService.geBoundManageDetail(),"查询成功");
    }
    /**
     *
     * @return Result
     */
    @GetMapping("/getDevotion")
    @ApiOperation(value = "实时库存")
    public R<List<DevotionDTO>> getDevotion() {
        return R.success(vsualizationService.getDevotion(),"查询成功");
    }

}
